Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce confusion in zfs_write #11191

Merged
merged 1 commit into from
Nov 18, 2020
Merged

Conversation

ghost
Copy link

@ghost ghost commented Nov 11, 2020

Motivation and Context

zfs/module/zfs/zfs_vnops.c

Lines 559 to 561 in b60ae3a

/*
* Is this block ever reached?
*/

I added some printfs and ran the tests to confirm: yes it is.

Description

Add asserts and comments to prove that when we get here, we have a full
block write at an aligned offset extending past EOF.

Simplify by removing the check that tx_bytes == max_blksz, since we can
assert that it is always true.

How Has This Been Tested?

ZTS on FreeBSD

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (a change to man pages or other documentation)

Checklist:

Is this block when abuf != NULL ever reached? Yes, it is.

Add asserts and comments to prove that when we get here, we have a full
block write at an aligned offset extending past EOF.

Simplify by removing the check that tx_bytes == max_blksz, since we can
assert that it is always true.

Signed-off-by: Ryan Moeller <[email protected]>
@ghost ghost added the Status: Code Review Needed Ready for review and testing label Nov 11, 2020
@codecov
Copy link

codecov bot commented Nov 11, 2020

Codecov Report

Merging #11191 (b60ae3a) into master (3fcd737) will decrease coverage by 0.10%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #11191      +/-   ##
==========================================
- Coverage   79.83%   79.73%   -0.11%     
==========================================
  Files         398      398              
  Lines      125766   125763       -3     
==========================================
- Hits       100410   100277     -133     
- Misses      25356    25486     +130     
Flag Coverage Δ
kernel 80.39% <0.00%> (-0.02%) ⬇️
user 66.15% <0.00%> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
cmd/zdb/zdb_il.c 30.86% <0.00%> (-24.08%) ⬇️
cmd/mount_zfs/mount_zfs.c 43.24% <0.00%> (-21.66%) ⬇️
module/zfs/space_map.c 93.17% <0.00%> (-5.13%) ⬇️
module/zfs/spa_checkpoint.c 93.78% <0.00%> (-4.35%) ⬇️
module/lua/lmem.c 83.33% <0.00%> (-4.17%) ⬇️
lib/libzfs/os/linux/libzfs_mount_os.c 68.86% <0.00%> (-1.89%) ⬇️
lib/libzfs/libzfs_changelist.c 84.44% <0.00%> (-1.86%) ⬇️
module/os/linux/zfs/vdev_file.c 80.55% <0.00%> (-1.86%) ⬇️
module/zfs/metaslab.c 94.30% <0.00%> (-1.58%) ⬇️
module/zfs/vdev_mirror.c 94.81% <0.00%> (-1.49%) ⬇️
... and 48 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3fcd737...28c5210. Read the comment docs.

@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Nov 17, 2020
@behlendorf behlendorf merged commit 85703f6 into openzfs:master Nov 18, 2020
@ghost ghost deleted the zfs_write-arcbuf branch November 19, 2020 19:59
behlendorf pushed a commit that referenced this pull request Dec 23, 2020
Is this block when abuf != NULL ever reached? Yes, it is.

Add asserts and comments to prove that when we get here, we have a full
block write at an aligned offset extending past EOF.

Simplify by removing the check that tx_bytes == max_blksz, since we can
assert that it is always true.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Ryan Moeller <[email protected]>
Closes #11191
jsai20 pushed a commit to jsai20/zfs that referenced this pull request Mar 30, 2021
Is this block when abuf != NULL ever reached? Yes, it is.

Add asserts and comments to prove that when we get here, we have a full
block write at an aligned offset extending past EOF.

Simplify by removing the check that tx_bytes == max_blksz, since we can
assert that it is always true.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Ryan Moeller <[email protected]>
Closes openzfs#11191
sempervictus pushed a commit to sempervictus/zfs that referenced this pull request May 31, 2021
Is this block when abuf != NULL ever reached? Yes, it is.

Add asserts and comments to prove that when we get here, we have a full
block write at an aligned offset extending past EOF.

Simplify by removing the check that tx_bytes == max_blksz, since we can
assert that it is always true.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Ryan Moeller <[email protected]>
Closes openzfs#11191
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Accepted Ready to integrate (reviewed, tested)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant